-
Notifications
You must be signed in to change notification settings - Fork 487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8343398: Add reducedData preference #1656
Conversation
👋 Welcome back mstrauss! A progress list of the required criteria for merging this PR into |
@mstr2 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 1 new commit pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
@mstr2 has indicated that a compatibility and specification (CSR) request is needed for this pull request. @mstr2 please create a CSR request for issue JDK-8343398 with the correct fix version. This pull request cannot be integrated until the CSR request is approved. |
Webrevs
|
This PR also includes a small refactor of the GTK and macOS The previous implementations had some parts of the change notification mechanism implemented outside of |
It works on my 14.6 machine. Let me try upgrading and testing again... |
I might suggest adding the instructions on how to control the platform settings as comments somewhere in the implementation.
|
(I've merged the latest master prior to testing) |
It also works on 15.1.1 on my machine. Just to check the obvious: did you close the WiFi Details window? The settings are only applied when you click OK. |
Update: I was getting interference from the VPN application. Getting off the VPN helped - I see the property and ( |
That's the expected result. |
I feel this wouldn't age well, considering that the particular UI used by the different operating systems has often changed over the years. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the scope of this change goes far beyond adding a few properties. It looks like a non-trivial refactoring that might also impact other platform preferences.
I did check that switching between light/dark modes on macOS results in proper updates, but the native code needs to be re-reviewed.
@@ -204,6 +187,7 @@ - (void)applicationWillFinishLaunching:(NSNotification *)aNotification | |||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |||
{ | |||
// unblock main thread. Glass is started at this point. | |||
self->platformSupport = [[PlatformSupport alloc] initWithEnv:env application:jApplication]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we check for failure here? (alloc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We never do that in obj-c native code, so this probably wouldn't be the place to start. In any case, a failure at this point wouldn't lead to a crash, as the only access of platformSupport
checks for nil
.
I think it has merit. Now that we need to re-test the functionality, it would have helped. Even when something changes, it will be easier to look up a few missing pieces than dig through the PRs... |
I think this sort of information is better suited for a Wiki. Btw, I can review the native code changes. Just not for a couple days. |
tested macOS behavior, all is well. BTW, I've updated the Monkey Tester to highlight changes in Tools -> Platform Preferences Monitor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested on macOS. needs testing on linux and windows.
The headful test run passed on Windows. While doing manual testing of other settings (since the notification logic has changed), I discovered a reproducible crash on Windows 11:
JavaFX will crash, likely in response to the notification of a change in animation effect. |
This is a weird one. I've narrowed it down to What is strange is that at least on my machine, The quick fix in this case is simply not calling the API in question in response to the unrelated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes all look good now.
I did notice one thing in macOS while reviewing the changes in PlatformSupport.m
. The PlatformSupport object stays around after the GlassApplication is terminated via finishTerminating. It will continue to process platform events, including making Java upcalls even after the FX toolkit is stopped. You would only see this with a Swing interop app that initializes FX and then later terminates it while keeping AWT alive. I think it is preexisting, and doesn't seem to be causing any problems. It might be worth a P4 follow-up issue to investigate.
Correction: the listeners no longer get notified after the FX toolkit is stopped, perhaps due to the fix forJDK-8335630. Needs more investigation. |
This is not related to JDK-8335630. The notification does get delivered, but ends up going through the "else" block in the following code in
This happens because So I think my recommendation of "maybe file a P4 bug to look at later" is the most that is needed here. |
I've added some code that ensures that the |
I highly recommend syncing up with the latest master once the PR branch is out for a prolonged period. This will ensure that the new changes do not interfere with the latest updates, and it also saves the reviewer's time as they need to merge in order to do a good review (times N reviewers). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good (macOS).
An observation: when running HelloJFXPanel
, noticed that the FX animation restarts each time the appearance preference gets changed between light and dark modes. This might be an existing issue since it can also be observed in the master branch.
I am not entirely sure this is expected, since neither the color of the animated rectangle nor the background color changes. It's unrelated to the changes in this PR (but might be related to the way the platform notifications are being processed).
Another observation related to the same animation, and also can be observed with the master branch: when one runs the HelloJFXPanel
app, the initial animation is smooth and is not affected by mouse over. Once the platform light/dark mode preference gets changed, however, the movement becomes jerky on mouse over.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
When I run it, it doesn't reset, it seems to jump -- often, but not always, to the beginning or end. In any case, it's completely unrelated to platform notifications: I just checked and it behaves the same way on JDK 8, which has no platform preference support.
I can't reproduce this on my system. If you can characterize this, please file a new bug. |
More on jerky animation: it's unrelated to the platform preferences change (which is good, for this PR anyway). It seems the jerky movement appears after HelloJFXPanel loses focus to some other window. Switch back, mouse over and the jerkiness starts. Happens even with the second external monitor disconnected. |
/integrate |
The
reducedData
preference instructs applications to minimize internet traffic, as users might be on a metered network or a limited data plan.This corresponds to the following OS settings:
Windows: Settings -> Network and Internet -> Ethernet/WiFi -> Metered connection
macOS: Settings -> Network -> Ethernet/WiFi -> Network Settings -> Low data mode
Ubuntu: Settings -> Network -> Wired/WiFi -> Metered connection
Change notifications work consistently on Windows and macOS. On my Ubuntu 24 system, the GIO
network-changed
signal is not sent when I only toggle the "metered connection" flag in network settings (and there's no signal specifically for low-data mode). The new value is only picked up when the connection changes by coming offline or going online./reviewers 2
/csr
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1656/head:pull/1656
$ git checkout pull/1656
Update a local copy of the PR:
$ git checkout pull/1656
$ git pull https://git.openjdk.org/jfx.git pull/1656/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1656
View PR using the GUI difftool:
$ git pr show -t 1656
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1656.diff
Using Webrev
Link to Webrev Comment